﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace haptic.src.engine.core
{
    public class Log
    {
        public static void Error(string sMsg)
        {
            Console.WriteLine("\n#########################################\nERROR\n");
            if (sMsg != null)
                Console.WriteLine(sMsg);
            else
                Console.WriteLine("Error returned");
            Console.WriteLine();
            StackFrame CallStack = new StackFrame(2, true);
            int lineNumber = CallStack.GetFileLineNumber();
            string sFrom = CallStack.GetFileName() + "\r\n";
            sFrom += "Line: " + lineNumber.ToString() + "\t";
            sFrom += "Method: " + CallStack.GetMethod();
            Console.WriteLine(sFrom);
            Console.WriteLine("#########################################\n");
        }
    }
}
